<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <main>
            <a href="https://www.baidu.com">百度</a>
            <a href="https://www.qq.com">腾讯</a>
        </main>
    </body>
</html>
<script>
    const main = document.querySelector("main");
    const regx = /(?<=href=(['"])).+(?=\1)/gi;
    main.innerHTML = main.innerHTML.replace(regx, `javascript:void(0)`);
</script>
